<%@ page language="java" pageEncoding="UTF-8"%><%@ include
	file="/WEB-INF/commons/taglibs.jsp"%>
<script type="text/javascript">
$(function(){
	function showMsg($item, msgType, msg, timeout){
		var classType='ui-state-highlight';
		if(msgType=='error'){
			classType='ui-state-error';
		}
		$item.addClass(classType);
		$item.html("<span class='ui-icon ui-icon-info' style='float: left; margin-right: .3em;'></span>"+msg);
		setTimeout(function(){$item.html('').removeClass(classType);},timeout);
	}
	function mkFridWith(name){
		$.ajax({
			url: '/user/ajax/mkFrid',
			data:'name='+name,
			type: 'POST',
			timeout: 15000,
			error: function(){showMsg($('#message'),'error','好友添加失败!',3000);},
			success: function(response){
				if(response.search('ERROR')!=-1){
					var msg=response.substring(5);
					showMsg($('#message'),'error','好友添加失败!'+msg,3000);
				}else{
					showMsg($('#message'),'info','好友添加成功!',3000);
				}
			}
		});
	}
	$('#mkFridWith').click(function(){mkFridWith('${it.user}')});
});
</script>
<!-- Flow展示区 -->
<table>
	<tr>
		<td>
		<div id="left" class="top-border">
		<p class="title">用户分享的电话</p>
		<c:forEach var="e" items="${it.flows}">
			<div class="nodeData">
			<div class="nodeData_title">${e.name}&nbsp;<a href="#"
				title="加入我的电话" flowId="${e.id}"
				class="ui-icon ui-icon-check flow-add">加入我的电话</a>&nbsp;</div>
			<div class="nodeData_content">${e.content}</div>
			<div class="nodeData_bottom"><fmt:formatDate
				value="${e.crtDate}" pattern="MM-dd HH:mm:ss" /></div>
			</div>
		</c:forEach></div>
		</td>
		<td>
		<div id="right" class="top-border">
		<div class="navContainer">
		<p class="title">该用户的电话分组</p>
		<ul>
			<c:forEach var="e" items="${it.packs}">
				<li>
				<p class="name"><a
					href="<c:url value="/user/${it.userName}/${e.id}"/>">${e.name}</a></p>
				</li>
			</c:forEach>
		</ul>
		</div>
		<div class="btnContainer">
		<button id="mkFridWith">加为好友</button>
		</div>
		</div>
		</td>
	</tr>
</table>